#include "StdAfx.h"
#include "Point.h"

namespace gfx {

Point::Point(void) : x_(0), y_(0)
{
}

Point::Point(int x, int y) : x_(x), y_(y)
{

}

Point::Point(const Point& point)
{
	*this = point;
}

Point::~Point(void)
{
}

Point& Point::operator=(const Point& rhs)
{
	this->x_ = rhs.x_;
	this->y_ = rhs.y_;

	return *this;
}

Point Point::operator+(const Point& rhs) const
{
	Point copy = *this;
	copy.Offset(rhs.x_, rhs.y_);
	return copy;
}

Point& Point::operator+=(const Point& rhs)
{
	this->Offset(rhs.x_, rhs.y_);
	return *this;
}

Point Point::operator-(const Point& rhs) const
{
	Point copy = *this;
	copy.Offset(-rhs.x_, -rhs.y_);
	return copy;
}

Point& Point::operator-=(const Point& rhs)
{
	this->Offset(-rhs.x_, -rhs.y_);
	return *this;
}

bool Point::operator==(const Point& rhs) const
{
	return this->x_ == rhs.x_ && this->y_ == rhs.y_;
}

bool Point::operator!=(const Point& rhs) const
{
	return !(this->x_ == rhs.x_ && this->y_ == rhs.y_);
}

bool Point::operator>(const Point& rhs) const
{
	return this->y_ == rhs.y_ ? this->x_ > rhs.x_ : this->y_ > rhs.y_;
}

bool Point::operator>=(const Point& rhs) const
{
	return *this == rhs || *this > rhs;
}

bool Point::operator<(const Point& rhs) const
{
	return this->y_ == rhs.y_ ? this->x_ < rhs.x_ : this->y_ < rhs.y_;
}

bool Point::operator<=(const Point& rhs) const
{
	return *this == rhs || *this < rhs;
}

} // namespace gfx